{{!connect "widget/top_menu_settings.js"}}
<ul class="top_menu service-menu">
	{{top_menu_content|safe}}
	{{?user_role=="administrator"}}
	<li class="item- edit- top_menu_edit"><a href="javascript: startEditTopMenu();">Редактировать</a></li>
	{{/?}}
</ul>


{{?user_role=="administrator"}}
<style>
.top_menu_edit { display: none; }
.moderator .top_menu_edit { display: block; }
.content- input { width: 400px; }
.top_menu_item { padding-bottom: 24px; }
.edit_top_menu_content { height: 400px; }
</style>

<a href="{{/}}get_top_menu_settings" id="top_menu_settiings_action"></a>

<div class="popup-widgets" id="top_menu_edit_popup" style="display: none;">
	<form action="{{/}}save_top_menu" method="post" id="save_top_menu_form">
	<h2 class="title-">Редактирование глобального меню</h2>
	<div class="content- edit_top_menu_content">
    <a href="javascript: modeSort();" id="sort_top_menu_trigger">сортировать пункты меню</a>
    <a href="javascript: modeEdit();" id="edit_top_menu_trigger" style="display: none;">редактировать пункты меню</a>
    <br /><br />
    <div id="top_menu_settings" class="wg-droppable"></div>
  </div>
	<div class="buttons-">
		<a href="javascript: saveEditTopMenu();" class="bn"><img src="{{images}}button-save-gray.gif" alt"Закрыть" class="submit- button-" /></a>
		<a href="javascript: closeEditTopMenu();" class="bn"><img src="{{images}}button-cancel-gray.gif" alt"Закрыть" class="cancel- button-" /></a>
	</div>
	</form>
</div>
{{/?}}